﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WcfServer.Classes.Utility;

namespace WcfServer.Classes.Client
{
    [Serializable]
    public class Ack
    {
        public DateTime TimeStamp { set; get; }

        public Ack(byte[] data,byte[] key)
        {
            byte[] temp = Utility.EncryptionHandler.DecryptAES(data, key);
            var ack = SerializerHandler<Ack>.DeSerializeInput(temp);
            this.TimeStamp = ack.TimeStamp;
        }

        public Ack()
        {
            // TODO: Complete member initialization
        }

        public byte[] Send(byte[] key)
        {
            var ack = SerializerHandler<Ack>.SerializeInput(this);
            return EncryptionHandler.EncryptAES(ack,key);
        }
    }
}
